/*
 * SpycherReedCO2Model.cpp
 *
 *  Created on: 12 Sep 2011
 *      Author: Allan
 */

#include "SpycherReedCO2Model.h"

const double SpycherReedFugacityCoefficientCO2(double T, double P, const VectorXd& n)
{
	const double Tk = T + 273.15;
	
	const double a = -1430.870;
	const double b =     3.598;
	const double c =  -227.376E-5;
	const double d =   347.644E-2;
	const double e = -1042.470E-5;
	const double f =   846.271E-8;
	
	return exp((a/Tk/Tk + b/Tk + c)*P + (d/Tk/Tk + e/Tk + f)*P*P*0.5);
}

const double SpycherReedFugacityCoefficientH2O(double T, double P, const VectorXd& n)
{
	const double Tk = T + 273.15;
	
	const double a =  -6191.4100;
	const double b =     14.8528;
	const double c =   -914.2670E-5;
	const double d =  -6633.2600E-2;
	const double e =  18277.0000E-5;
	const double f = -13274.0000E-8;
	
	return exp((a/Tk/Tk + b/Tk + c)*P + (d/Tk/Tk + e/Tk + f)*P*P*0.5);
}
